package top.hymsk.ecommerce.pojo.DTO;

import lombok.Data;
import top.hymsk.ecommerce.pojo.DO.OrderOverviewDO;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author 花于陌上开
 */
@Data
public class OrderSellerOverviewListDTO {
    Integer total;
    List<OrderDetailDTO> orderList;

    public OrderSellerOverviewListDTO(List<OrderOverviewDO> orderDOList, Integer number) {
        this.total = number;
        this.orderList = new ArrayList<>();
        this.orderList =orderDOList.stream().map(OrderDetailDTO::new).collect(Collectors.toList());
    }
}
